#ifndef ThresholdSameRegion_HPP
#define ThresholdSameRegion_HPP

#include <girl/girlToger.hpp>
#include <girlTools/girlToolsImage.hpp>


/*!
  *
  * This class tells if two points are both in the same region :
  * i.e :
  *  \code if (image(x,y) <= T && image(x,y) <= T)
  *          || (image(x,y) > T && image(x,y) > T)
  *  \endcode
  */
class ThresholdSameRegion : public girl::toger::sameRegion
{
public:
    ThresholdSameRegion(const girl::tools::Image &image, int threshold);
    bool same(const girl::point &p, girl::direction dir);
private :
    const girl::tools::Image &_image;
    int _threshold;
};

#endif // GLOBALTHRESHOLDBINARISATION_HPP
